//
//  Extension+UILabel.swift
//  SHWeibo
//
//  Created by jingming wang on 16/7/23.
//  Copyright © 2016年 cpy.name. All rights reserved.
//

import UIKit

extension UILabel {
    
    convenience init(text: String?, textColor: UIColor? = UIColor.blackColor(), font: CGFloat = 17, numberOfLines:Int = 1, textAlignment: NSTextAlignment = .Left, maxWidth: CGFloat = 0) {
        self.init()
        self.text = text
        self.textColor = textColor
        self.font = UIFont.systemFontOfSize(font)
        self.numberOfLines = numberOfLines
        self.textAlignment = textAlignment
        
        if maxWidth > 0 {
            self.preferredMaxLayoutWidth = maxWidth
        }
    }
}
